public class Hello {
    public static void main(String[] args) {
        for (int i = 1; i <= 20; i++) {
            for (int j = 1; j <= 33; j++) {
                for (int k = 3; k <= 99; k += 3) {
                    if (i + j + k == 100 & i * 5 + j * 3 + k / 3 == 100) {
                        System.out.println("公鸡有" + i + "只，母鸡有" + j + "只，小鸡有" + k + "只");
                    }
                }
            }
        }

    }

}